package com.ngkj.zmfptback.sys.service.read.impl;

import com.ngkj.zmfptback.sys.bean.RealUserEntity;
import com.ngkj.zmfptback.sys.mapper.read.RealUserReadMapper;
import com.ngkj.zmfptback.sys.service.read.RealUserReadService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * @author ChenHN
 * @since 2022/1/9 creation
 **/
@Service
@Transactional(readOnly = true)
public class RealUserReadServiceImpl implements RealUserReadService {

    @Resource
    private RealUserReadMapper realUserReadMapper;

    @Override
    public RealUserEntity getRealUserInfo(Long realUserId) {
        RealUserEntity realUserInfo = realUserReadMapper.getRealUserInfo(realUserId);
        String idCard = realUserInfo.getIdCard();
        String replace = idCard.substring(4,idCard.length()-4);
        String newIdCard = idCard.replace(replace,"**********");
        realUserInfo.setIdCard(newIdCard);
        return realUserInfo;
    }
}
